//
//  EmojiCollectionViewCell.m
//  Emoji表情
//
//  Created by zxy on 2019/5/30.
//  Copyright © 2019 zxy. All rights reserved.
//

#import "EmojiCollectionViewCell.h"
@interface EmojiCollectionViewCell()
@property(nonatomic,strong)UIButton *emojiButton;
@end
@implementation EmojiCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        UIButton *emojiBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        emojiBtn.frame = self.bounds;
        emojiBtn.userInteractionEnabled = NO;
        [self.contentView addSubview:emojiBtn];
        self.emojiButton = emojiBtn;
    }
    return self;
}

-(void)setEmojiModel:(EmojiContentModel *)emojiModel{
    _emojiModel = emojiModel;
    if(emojiModel.isDeleteBtn){
        [self.emojiButton setImage:[UIImage imageNamed:@"delete-emoji"] forState:UIControlStateNormal];
    }else{
         [self.emojiButton setImage:[UIImage imageNamed:emojiModel.image] forState:UIControlStateNormal];
    }
}

@end
